'''
Created on Jul 15, 2010
@author: mjbommar
'''

import igraph
import graphmovie
import graphmovie.graphSequence
import graphmovie.render2D

seq = graphmovie.graphSequence.graphSequence()

edges = [(0,1),(1,2),(1,3)]
g = igraph.Graph(edges)
g.vs['label'] = map(str, range(g.vcount()))
g.vs[0]['graphmovie_label'] = 'VERTEX'
g.es[0]['graphmovie_label'] = 'EDGE'
seq.addGraph(g)


edges.append((4,1))
g = igraph.Graph(edges)
g.vs['label'] = map(str, range(g.vcount()))
g.vs[0]['graphmovie_label'] = 'VERTEX'
g.es[0]['graphmovie_label'] = 'EDGE'
seq.addGraph(g)

edges.extend([(5,2),(6,5),(7,5),(8,5),(8,7),(9,8)])
g = igraph.Graph(edges)
g.vs['label'] = map(str, range(g.vcount()))
g.vs[0]['graphmovie_label'] = 'VERTEX'
g.es[0]['graphmovie_label'] = 'EDGE'
seq.addGraph(g)

edges.extend([(5,3),(6,2),(7,2),(8,3),(8,2)])
g = igraph.Graph(edges)
g.vs['label'] = map(str, range(g.vcount()))
g.vs[0]['graphmovie_label'] = 'VERTEX'
g.es[0]['graphmovie_label'] = 'EDGE'
seq.addGraph(g)

render = graphmovie.render2D.render2D(seq)
render.calculateLayout()
render.render()
